Hi,
I have a Welcome form which offers a list of reports for the user to choose from, and a Submit button. The Submit button calls a LS agent using @Command([ToolsRunMacro]; "MyAgent"). MyAgent contains the following code:
=========================
Sub Initialize
Dim session_this As New NotesSession
Dim doc_this As NotesDocument
Dim str_print As String
Set doc_this = session_this.DocumentContext
str_print = "
http://myserver.com/mydatabase.nsf/ReportForm?OpenForm"
Print {<script type="text/javascript">window.location="} + str_print + {";window.document.forms[0].ReportType.value = "} & Cstr(doc_this.ReportType(0)) & {";window.document.forms[0].UserReport.value = "} & Cstr(doc_this.UserReport(0)) & {";document.location.reload(true);</script>}
End Sub
==========================
What I want to do is (1) open the form in my browser, (2) fill the ReportType and UserReport fields in with values obtained from the Welcome form, and (3) load an embedded view on the ReportForm with the value of UserReport (ReportForm currently has an embedded view with a selection by formula, and the formula is "UserReports"). When I try the code above, the ReportForm loads, but the ReportType and UserReport fields are not loaded, and so the form opens up as blank.
How can I open this form, prefill it with my field values, and do a document refresh or whatever else is necessary to load my embedded view with my field values? Any help is appreciated on this one.
Thanks in advance,
Sam